<fieldset class="work meta">
  <p><%= h t('.tags', :default =>"Work Tags (comma separated, %{max} characters per tag)", :max => ArchiveConfig.TAG_MAX) %><%= link_to_help "tagging-help" %></p>
  <dl>
    <dt class="rating required">
      <label for="work_rating_string"><%= Rating::NAME %>*<%= link_to_help "rating-help" %></label>
    </dt>
    <dd class="rating required">
      <select id="work_rating_string" name="work[rating_string]">
      <%= options_for_select((include_blank ? [""] : []) +  [ArchiveConfig.RATING_DEFAULT_TAG_NAME, ArchiveConfig.RATING_GENERAL_TAG_NAME, ArchiveConfig.RATING_TEEN_TAG_NAME, ArchiveConfig.RATING_MATURE_TAG_NAME, ArchiveConfig.RATING_EXPLICIT_TAG_NAME], :selected => include_blank ? nil : rating_selected(@work) ) %>
      </select>
    </dd>

    <dt class="warning required">
      <label><%= Warning::NAME.pluralize %>*<%= link_to_help "warning-help" %></label>
    </dt>
    <dd class="warning required">
      <dl>
        <% for tag in Warning.canonical.by_name %>
        <dt><%= check_box_tag "work[warning_strings][]", tag.name, include_blank ? false : check_warning(@work, tag), :id => "work_warning_strings_#{tag.id}" %></dt>
        <dd><%= label_tag "work_warning_strings_#{tag.id}", tag.name %></dd>
        <% end %>
      </dl>
    </dd>

    <dt class="fandom required">
      <label for="work_fandom"><%= Fandom::NAME.pluralize %>*</label>
    </dt>
    <dd class="fandom required">
      <%= text_field_tag "work[fandom_string]", include_blank ? "" : @work.fandom_string, :id => "work_fandom" %>
      <%= autocomplete_text_field("work_fandom") %>
    </dd>
  	<dd class="fandom delay_notice"><%=h t('.first_for_fandom', :default => "If this is the first work for a fandom, it may not show up in the fandoms page for a day or two") %></dd>

    <dt class="category">
      <label><%= Category::NAME %></label>
    </dt>
    <dd class="category">
      <dl>
        <% for tag in Category.canonical.by_name %>
        <% cycle_class = cycle("odd", "even") %>
        <dt class="<%= cycle_class %>"><%= check_box_tag "work[category_string][]", tag.name, include_blank ? false : @work.category_strings.include?(tag.name), :id => "work_category_string_#{tag.id}" %></dt>
        <dd class="<%= cycle_class %>"><%= label_tag "work_category_string_#{tag.id}", tag.name %></dd>
        <% end %>
      </dl>
    </dd>

    <dt class="relationship">
      <label for="work_relationship"><%= Relationship::NAME.pluralize %></label>
    </dt>
    <dd class="relationship">
      <%= text_field_tag "work[relationship_string]", include_blank ? "" : @work.relationship_string, :id => "work_relationship" %>
      <%= autocomplete_text_field "work_relationship", :methodname => "relationship_finder_restricted_by_fandom", 
                                                       :auto_params => ["work_fandom"], 
                                                       :extra_params => "fandom_fieldname=fandom_string&no_alert=true" %>
    </dd>

    <dt class="character">
      <label for="work_character"><%= Character::NAME.pluralize %></label>
    </dt>
    <dd class="character">
      <%= text_field_tag "work[character_string]", include_blank ? "" : @work.character_string, :id => "work_character" %>
      <%= autocomplete_text_field "work_character", :methodname => "character_finder_restricted_by_fandom", 
                                                       :auto_params => ["work_fandom"], 
                                                       :extra_params => "fandom_fieldname=fandom_string&no_alert=true" %>
    </dd>

    <dt class="freeform">
      <label for="work_freeform"><%= Freeform::NAME %></label>
    </dt>
    <dd class="freeform">
      <%= text_field_tag "work[freeform_string]", include_blank ? "" : @work.freeform_string, :id => "work_freeform" %>
      <%= autocomplete_text_field("work_freeform") %>
    </dd>

  </dl>
</fieldset>
